﻿using B.MES.Customer.Infrastructure;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace B.MES.Customer.Read.WebApi.Controllers
{
    /// <summary>
    /// 迁移管理控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class ValuesController : ControllerBase
    {
        /// <summary>
        /// 上下文服务
        /// </summary>
        public readonly DbcontextEcm db;
        /// <summary>
        /// 注入上下文
        /// </summary>
        /// <param name="db">上下文服务</param>
        public ValuesController(DbcontextEcm db)
        {
            this.db = db;
        }
        /// <summary>
        /// 创建数据库表格
        /// </summary>
        /// <returns>操作结果消息</returns>
        [HttpGet]
        public string CreateTable()
        {
            db.CreateTable();
            return "hehe";
        }
        /// <summary>
        /// 创建类文件
        /// </summary>
        /// <returns>操作结果，true表示成功，false表示失败</returns>
        [HttpGet]
        public bool CreateClassFile()
        {
           db.CreateClassFile();
           return true;
        }
       
    }
}
